void CMyListView::OnEditDelete() 
{
	// TODO: Add your command handler code here
	CDlgDelete dlg;
	dlg.m_nRadio = 0;
	// Display the dialog box.
	int result = dlg.DoModal();
	// If the user clicked the OK button...
	if (result == IDOK)
	{
		CStudent* m_pStudent = NULL;
		// Make sure the list isn't empty.
		if (m_List.IsEmpty())
			MessageBox("ڵѾȫɾ!");
		else
		{
			// Remove the specified node.
			if (dlg.m_nRadio == 0)
				m_pStudent = (CStudent*)m_List.RemoveHead();
			else if(dlg.m_nRadio == 1)
				m_pStudent = (CStudent*)m_List.RemoveTail();
			else 
			{
				if(dlg.m_nNumber < m_List.GetCount())
				{
					POSITION pos = m_List.FindIndex(dlg.m_nNumber);
					POSITION pos1 = pos;
					m_pStudent = (CStudent*)m_List.GetNext(pos1);
					m_List.RemoveAt(pos);
				}
				else
				{
					MessageBox("ָڵ㳬Χ!");
				}
			}
			// Delete the node object and repaint the window.
			if(m_pStudent)
				delete m_pStudent;
			Invalidate();
		}
	}
}

